package com.bpz.jxw.link.service.impl;

import com.bpz.jxw.link.dao.LinkDao;
import com.bpz.jxw.link.model.Link;
import com.bpz.jxw.link.service.ILinkService;
import com.bpz.main.model.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by 半瓶子 on 2/7/15.
 * blog: xusir.cnblogs.com
 */
@Service
public class LinkService implements ILinkService {
    @Autowired
    LinkDao linkDao;



    /**
     * 分页查询
     *
     * @param map       查询条件
     * @param pageIndex 当前页索引
     * @param pageSize  每页记录数
     * @return
     */
    @Override
    public List<Link> selectPage(Map<String, Object> map, int pageIndex, int pageSize) {
        Page page=new Page(pageIndex,pageSize);
        if (map!=null&&map.size()>0)
        {
            page.setCondition(map);
        }
        List<Link> links= linkDao.selectPage(page);
        return links;
    }
}
